<?php
/* @var $this CmpServicesController */
/* @var $model CmpServices */

$this->breadcrumbs=array(
	'综合控制台'=>array($this->pre_module_url.'/index/index'),
	'客户服务'=>array($this->pre_module_url.'/cmpServices/admin'),
	'客服设置'=>array($this->pre_module_url.'/cmpServices/admin'),
);
?>

<table class="list_table list_table2" width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<th width="">默认</th>
		<th width="20%">客服名称</th>
		<th width="15%">客服类型</th>
		<th width="20%">账号</th>
		<th class="tl" width="15%">客服电话</th>
		<th class="tl" width="10%">排序</th>
		<th width="12%">操作</th>
	</tr>
</table>

<?php $this->widget('zii.widgets.CListView', array(
    'dataProvider'=>$model->search(),
    'itemView'=>'_view',
	'template'=>'{items}',
	'itemsTagName'=>'table',
	'itemsOptions'=>array('class'=>'list_table list_table2 cate','width'=>'100%','cellpadding'=>0,'cellspacing'=>0),
));?>
<?php echo $this->renderPartial('_form', array('model'=>$newModel)); ?>

<script type="text/javascript">
//ajax设默认
$('.default_radio').bind('click',function(){
	var id = $(this).attr('value');
    $.ajax({
    	type: "GET",
    	url: '<?php echo $this->pre_module_url.'/cmpServices/ajaxSetDefault'?>',
    	data: "id="+id,
    	success: function(msg){
    		if(msg==1){
    			art.dialog({title: '提示',content: '设置成功！'}).time(1000);
				return false;
		    }else{
		    	alert(msg)
			}
    	}
    })
});
//ajax排序上移
$('.uplist').live('click',function(){
	var urls = $(this).attr('href') ;
	var th = $(this);
    $.ajax({
    	type: "GET",
    	url: urls,
    	data: "ajax=deleteajax",
    	success: function(msg){
    		if(msg==1){
    	        var a = th.parent().parent();
    	        a.prev('tr').before(a);
				return false;
		    }else{
		    	alert(msg)
			}
    	}
    })
	return false;
});
//ajax排序下移
$('.downlist').live('click',function(){
	var urls = $(this).attr('href') ;
	var th = $(this);
    $.ajax({
    	type: "GET",
    	url: urls,
    	data: "ajax=deleteajax",
    	success: function(msg){
    		if(msg==1){
    	        var a = th.parent().parent();
    	        a.next('tr').after(a);
				return false;
		    }else{
		    	alert(msg)
			}
    	}
    })
	return false;
});
</script>

